#include "SplashScreen.h"
#include "Gfx.h"
#include "ResourceMgr.h"
#include "GfxEffects.h"

#include <iostream>
using namespace std;

SplashScreen *SplashScreen::instance_ = NULL;

void
SplashScreen::
start () {
	GameComponent::start();

	// Blit the splash screen and wait
	Gfx *gfx = Gfx::instance();
	SDL_Surface *disp    = gfx->getScreen();
	SDL_Surface *splash  = ResourceMgr::instance()->getGfx("splash.png");

	SDL_Rect rect;
	rect.x = rect.y = 0;
	rect.w = 1024;
	rect.h = 768;

	SDL_BlitSurface (splash, &rect, disp, &rect);
	SDL_UpdateRects (disp, 1, &rect);

	SDL_Delay(4000);

	faderZoneOut();

  SDL_Delay(1000);
	switch_to("MenuScreen");
}

void
SplashScreen::
stop () {
	GameComponent::stop();

}

